home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / rpcsvc / klm_prot.x < prev    next >
Text File  |  1990-01-29  |  2KB  |  92 lines

  1. /*    @(#)klm_prot.x    1.3 88/05/26 4.0NFSSRC SMI    */
  2.  
  3. /* 
  4.  * Copyright (c) 1988 by Sun Microsystems, Inc.
  5.  * @(#) from SUN 1.9
  6.  */
  7.  
  8. /*
  9.  * Kernel/lock manager protocol definition
  10.  * Copyright (C) 1986 Sun Microsystems, Inc.
  11.  *
  12.  * protocol used between the UNIX kernel (the "client") and the
  13.  * local lock manager.  The local lock manager is a deamon running
  14.  * above the kernel.
  15.  */
  16. const    LM_MAXSTRLEN = 1024;
  17.  
  18. /*
  19.  * lock manager status returns
  20.  */
  21. enum klm_stats {
  22.     klm_granted = 0,    /* lock is granted */
  23.     klm_denied = 1,        /* lock is denied */
  24.     klm_denied_nolocks = 2, /* no lock entry available */
  25.     klm_working = 3     /* lock is being processed */
  26. };
  27.  
  28. /*
  29.  * lock manager lock identifier
  30.  */
  31. struct klm_lock {
  32.     string server_name<LM_MAXSTRLEN>;
  33.     netobj fh;        /* a counted file handle */
  34.     int pid;        /* holder of the lock */
  35.     unsigned l_offset;    /* beginning offset of the lock */
  36.     unsigned l_len;        /* byte length of the lock;
  37.                  * zero means through end of file */
  38. };
  39.  
  40. /*
  41.  * lock holder identifier
  42.  */
  43. struct klm_holder {
  44.     bool exclusive;        /* FALSE if shared lock */
  45.     int svid;        /* holder of the lock (pid) */
  46.     unsigned l_offset;    /* beginning offset of the lock */
  47.     unsigned l_len;        /* byte length of the lock;
  48.                  * zero means through end of file */
  49. };
  50.  
  51. /*
  52.  * reply to KLM_LOCK / KLM_UNLOCK / KLM_CANCEL
  53.  */
  54. struct klm_stat {
  55.     klm_stats stat;
  56. };
  57.  
  58. /*
  59.  * reply to a KLM_TEST call
  60.  */
  61. union klm_testrply switch (klm_stats stat) {
  62.     case klm_denied:
  63.         struct klm_holder holder;
  64.     default: /* All other cases return no arguments */
  65.         void;
  66. };
  67.  
  68.  
  69. /*
  70.  * arguments to KLM_LOCK
  71.  */
  72. struct klm_lockargs {
  73.     bool block;
  74.     bool exclusive;
  75.     struct klm_lock alock;
  76. };
  77.  
  78. /*
  79.  * arguments to KLM_TEST
  80.  */
  81. struct klm_testargs {
  82.     bool exclusive;
  83.     struct klm_lock alock;
  84. };
  85.  
  86. /*
  87.  * arguments to KLM_UNLOCK
  88.  */
  89. struct klm_unlockargs {
  90.     struct klm_lock alock;
  91. };
  92.